Implementation Plan: T5-P5-A5-WP1 Define the Typed Failure Envelope and Factory Helpers#4106
Merged
Trecek merged 2 commits intoJun 13, 2026
Conversation
Add ToolFailureEnvelope TypedDict with a retriable discriminator and two factory helpers (server_failure_envelope, input_failure_envelope) to src/autoskillit/server/tools/_types.py. The new type is distinct from the existing _kitchen_failure_envelope function in tools_kitchen.py, which returns a raw JSON string with a kitchen field; this TypedDict provides a typed dict contract with a retriable discriminator for P5-A4 orchestrator routing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comparing hints['success'] is typing.Literal[False] is unreliable since Literal objects are not guaranteed to be singletons. Switch to typing.get_args(hints['success']) == (False,) for a portable assertion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
ToolFailureEnvelopeTypedDict with aretriablediscriminator and two factory helpers (server_failure_envelope,input_failure_envelope) tosrc/autoskillit/server/tools/_types.py. This provides a typed contract for structured failure responses that downstream P5-A4 WPs will consume, enabling orchestrator routing based on retriability. The new type is intentionally distinct from the existing_kitchen_failure_envelopefunction intools_kitchen.py— that function returns a raw JSON string with akitchenfield; this TypedDict provides a typed dict contract with aretriablediscriminator.Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/impl-20260613-032734-695911/.autoskillit/temp/make-plan/t5-p5-a5-wp1-define-typed-failure-envelope_plan_2026-06-13_033600.mdCloses #4038
🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown